from django import forms
from common.utils.custom_form_field import JsonArrayField


class UserLoginForm(forms.Form):
    username = forms.CharField()
    password = forms.CharField()


class UserListForm(forms.Form):
    id = forms.IntegerField(required=False)
    username = forms.CharField(required=False)
    role = JsonArrayField(required=False)
    size = forms.CharField(required=False)
    page = forms.CharField(required=False)


class UserUpdateForm(forms.Form):
    password = forms.CharField(required=False)
    current_password = forms.CharField(required=False)


class UserCreateForm(forms.Form):
    username = forms.CharField()
    password = forms.CharField()


class UpdateUserMerchantRoleForm(forms.Form):
    user_id = forms.IntegerField()
    new_role_id = forms.IntegerField()
    description = forms.CharField(max_length=128)


class ResetUserPasswordForm(forms.Form):
    user_id = forms.IntegerField()
